<?php
/*
usage:
php xp_console_upgrade_plugin.php fastadmin_addons_csmwj csmwj ../../chenshiming0802srcA
*/
// 获取传入的参数
$projectname = $argv[1];
$pluginname = $argv[2];
$targetpath = $argv[3];
$uc_pluginname = ucfirst($pluginname);
$dist_projectpath = "dist/{$projectname}";

include "xp_project_function.php";

createDirectory("{$targetpath}");
createDirectory("{$targetpath}/{$projectname}");

$exceptfilenames = [
    "{$dist_projectpath}/addons/{$pluginname}/bootstrap.js",
    "{$dist_projectpath}/addons/{$pluginname}/install.sql",
    "{$dist_projectpath}/addons/{$pluginname}/config.php",
    "{$dist_projectpath}/addons/{$pluginname}/{$uc_pluginname}.php",
    "{$dist_projectpath}/addons/{$pluginname}/_deploy",
    "{$dist_projectpath}/addons/{$pluginname}/library/xpconfig.php",
    "{$dist_projectpath}/addons/{$pluginname}/uniapp/{$pluginname}_mobile/pages/{$pluginname}/main"
];
xcopy($dist_projectpath, "{$targetpath}/{$projectname}", $exceptfilenames);
